import React, {Component} from 'react'
import 'src/pages/homeContainer/home.less'
import ajax from 'src/assets/js/httpRequest'
import {URI_TEST} from "src/const/api";
import {Carousel, Card} from 'antd'
import MovieColumn from 'src/components/Movie/MovieColumn'

export default class Home extends Component {
  constructor(props) {
    super(props);
    this.state = {
      vModel: '',
      count: 0
    }
  }

  componentDidMount() {
    ajax.get('/v2/movie/top250?start=25&count=25', {
    }).then(res=>{
      console.log(res);
    });
  }

  handleChange = (even) => {
    console.log(even.target.value);
    this.setState({
      vModel: even.target.value
    })
  };
  buttonClick = () => {
    let count = this.state.count;
    count += 1;
    console.log(count);
    this.setState({
      count: count
    })
  };

  render() {
    return (
        <Card className='home'>
          <div className='carousel'>
            <Carousel autoplay dots={true}>
              <div><img src="/static/image/movie_carousel_1.jpg"/></div>
              <div><img src="/static/image/movie_carousel_2.jpg"/></div>
              <div><img src="/static/image/movie_carousel_3.jpg"/></div>
              <div><img src="/static/image/movie_carousel_4.jpg"/></div>
            </Carousel>
          </div>
          <MovieColumn
              id='hotShowing'
              title='热门电影'
              type='in_theaters'
              total={8}
              noHead={true}
              count={5}
          />
        </Card>
    )
  }
}